package com.chinamobile.websocket.websocket.scene.sceneimp;

import com.alibaba.fastjson.JSON;
import com.chinamobile.websocket.domain.dto.SceneDto;
import com.chinamobile.websocket.websocket.scene.AbstractEndpointHandlerImpl;
import com.chinamobile.websocket.domain.dto.MessageDto;
import org.springframework.stereotype.Component;

/**
 * @className: DefaultEndpointHandlerImpl
 * @description 默认实现
 * @author: fanzhijun
 * @date: 2023/12/29
 **/
@Component("defaultEndpointHandlerImpl")
public class DefaultEndpointHandlerImpl extends AbstractEndpointHandlerImpl {
    @Override
    public SceneDto getScene() {
        return new SceneDto(0, "默认实现", this.getClass());
    }

    @Override
    public String getMessage(MessageDto messageDto) {
        return JSON.toJSONString(messageDto.getData());
    }
}
